package com.ocom.payconfig.controller;

import com.ocom.common.constant.PayConfigUrl;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.payconfig.schoolwifiinfo.SchoolWifiInfoVo;

import com.ocom.payconfig.service.SchoolWifiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SchoolWifiController {

    @Autowired
    private SchoolWifiService schoolWifiService;

    @PostMapping(PayConfigUrl.Url_getSchoolWifiList)
    public Result getSchoolWifiList(@RequestBody SchoolWifiInfoVo schoolWifiInfoVo) {
        Long comId = Long.valueOf(schoolWifiInfoVo.getComId());
        return schoolWifiService.selectSchoolWifi(comId, schoolWifiInfoVo);
    }

    @PostMapping(PayConfigUrl.Url_updateSchoolWifiInfo)
    public Result requestSchoolWifi(@RequestBody SchoolWifiInfoVo schoolWifiInfoVo) {
        Long comId = Long.valueOf(schoolWifiInfoVo.getComId());
        return schoolWifiService.modifySchoolWifi(comId, schoolWifiInfoVo);
    }
}
